<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<title>[(${dto.menu.title})]</title>
	<meta name="renderer" content="webkit">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
	<meta name="apple-mobile-web-app-status-bar-style" content="black">
	<meta name="apple-mobile-web-app-capable" content="yes">
	<meta name="format-detection" content="telephone=no">
	<link rel="icon" type="image/x-icon" href="/static/img/favicon.ico">
	
	<th:block th:include="include/src :: grid_base_js_and_css"/>
	
	<style>
	html {height: 100vh;background-color: #ffffff;}
	body {height: 100vh;}
	</style>
</head>
<body>
	<div class="display_flex" style="height: 100%;" id="id_panel_content">
	</div>
	
	<!-- 引用字段TPL自定义脚本 -->
	<th:block th:include="include/gird-tpl :: TPLScript"/>
	
	<script type="text/html" id="toolbarDemo">
	<div class="layui-btn-container">
		<a th:each="button : ${dto.toolbar.buttonArr}" class="layui-btn layui-btn-normal layui-btn-xs" th:lay-event="${button.event}"><i class="iconfont" th:classappend="${button.icon}"></i>[(${button.name})]</a>
	</div>
	</script>
	
	<script th:inline="javascript">
	// 搜索表单初始化
	var gridObj = null;
	//使用layui的模块
	layui.config({
		//自定义layui组件的目录,设定扩展的layui模块的所在目录，一般用于外部模块扩展
		base: '/static/js/layui_extends/'
	}).use(['form', 'jquery', 'element', 'table', 'dropdown', 'optimizeSelectOption', 'util', 'laydate', 'YsGrid'], function(){
		var $ = layui.jquery;
		var dropdown = layui.dropdown;
		var element = layui.element;
		var form = layui.form;
		var laydate = layui.laydate;
		var table = layui.table;
		var util = layui.util;
		var YsGrid = layui.YsGrid;
		gridObj = YsGrid.init({
			id_panel_content: 'id_panel_content',
			conditions: $.parseJSON(JSON.stringify([[${dto.conditions}]])),
			menuId: [(${dto.menuId})],
			templateType: '[(${dto.templateType})]',
			pathGridRequest: '[(${dto.menu.pathGridRequest})]',
			cols: [ [(${dto.colGrids})] ]
		});
	});
	
	// 在表格上修改
	function doEditOnTable(dataCommit) {
		var indexOfLoading = layer.load(1, {
			shade: [0.5,'#000000'] //0.1透明度的白色背景
		});
		$.post('[(${dto.menu.pathGridEditRequest})]', dataCommit, function(res){
			if (res.code == 0) {
				layer.msg(res.msg);
				layer.close(indexOfLoading);
			} else {
				layer.close(indexOfLoading);
				layer.msg(res.msg);
			}
		});
	}
	
	// 调整鼠标移动到每行数据时的样式
	$('body').on("mouseenter",".layui-table-body tr",function () {
	    $(this).siblings().find("div").css("color","#142A48");
	    $(this).find("div").css("color","#4DA1FF");
	})
	</script>
</body>
</html>